<html>
<head><meta charset="utf-8"><title>moving once cell forward · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html">moving once cell forward</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246212762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246212762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246212762">(Jul 16 2021 at 11:47)</a>:</h4>
<p>Hey, long ago I've noticed that <a href="https://github.com/rust-lang/rust/issues/74465">https://github.com/rust-lang/rust/issues/74465</a> is being stuck. I am wondering, if there are some quick things I can do to unblock it?</p>
<p>I feel that it is mostly blocked on implementation work (current impl blocker: <a href="https://github.com/rust-lang/rust/issues/74465">https://github.com/rust-lang/rust/issues/74465</a>), but I don't have capacity for moving the work forward myself :(</p>



<a name="246222901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246222901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246222901">(Jul 16 2021 at 13:32)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> you posted the same link twice -- what's the blocker?</p>



<a name="246224116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246224116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246224116">(Jul 16 2021 at 13:42)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/74465#issuecomment-783294558">https://github.com/rust-lang/rust/issues/74465#issuecomment-783294558</a></p>
<p>Some renames basically</p>



<a name="246239572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246239572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246239572">(Jul 16 2021 at 15:37)</a>:</h4>
<p>we can nominate the issue for discussion during our next T-libs-API meeting and hopefully work through the naming questions</p>



<a name="246271424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246271424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246271424">(Jul 16 2021 at 20:01)</a>:</h4>
<p>I'm happy to do these renames. But surely the next step is really to accept the RFC at <a href="https://github.com/rust-lang/rfcs/pull/2788">https://github.com/rust-lang/rfcs/pull/2788</a> first?</p>



<a name="246271468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246271468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246271468">(Jul 16 2021 at 20:01)</a>:</h4>
<p>(And if it's up for discussion next week I'll hold off on a rename PR until that happens)</p>



<a name="246274325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246274325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246274325">(Jul 16 2021 at 20:28)</a>:</h4>
<p>yea, probably best to wait until the meeting before making any changes incase we decide against them</p>



<a name="246274348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246274348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246274348">(Jul 16 2021 at 20:28)</a>:</h4>
<p>and also dang, didn't realize that the RFC hadn't been accepted</p>



<a name="246278255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246278255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246278255">(Jul 16 2021 at 21:01)</a>:</h4>
<p>Note that RFC wasn’t accepted because we wanted to have impl in std before accepting the rfc</p>



<a name="246278771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246278771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246278771">(Jul 16 2021 at 21:03)</a>:</h4>
<p><a href="https://github.com/rust-lang/rfcs/pull/2788#issuecomment-558227921">https://github.com/rust-lang/rfcs/pull/2788#issuecomment-558227921</a></p>



<a name="246278803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246278803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246278803">(Jul 16 2021 at 21:03)</a>:</h4>
<p>FWIW on the names, I know people want to break up the <code>sync</code> module, but it’d be great if the migration path to std was this.</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">use</span><span class="w"> </span><span class="n">once_cell</span>::<span class="n">sync</span>::<span class="n">Lazy</span><span class="p">;</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">sync</span>::<span class="n">Lazy</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="246628866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246628866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246628866">(Jul 20 2021 at 18:15)</a>:</h4>
<p>Peanut gallery comment on the names: These feel like the first time people will use them is in <code>static</code>, so it'd be nice if the one with the shorter name was the one that worked there.  Especially since using the thread-safe one accidentally is just a minor perf hit, not something that makes it fail compilation.</p>
<p>I worry that with the current nightly names the normal experience will be <code>static FOO: Lazy&lt;...&gt;</code>, get an error, go "oh yeah", and change to <code>SyncLazy</code>.</p>



<a name="246630814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246630814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246630814">(Jul 20 2021 at 18:31)</a>:</h4>
<p>yeah, SyncLazy is superfluous unless we have an UnsynchLazy too. Otherwise just call it Lazy.</p>



<a name="246635544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246635544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246635544">(Jul 20 2021 at 19:12)</a>:</h4>
<p>we do have that, there's both a Sync and !Sync version, and only the former can be used in statics</p>



<a name="246635823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246635823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246635823">(Jul 20 2021 at 19:15)</a>:</h4>
<p>the tension here is that the Sync version feels more generally useful, but the unSync one feels more theoretically fundamental, and only one of them can just be called <code>Lazy</code>, unless you put them in separate modules and call them both <code>Lazy</code> which seems confusing in its own right</p>



<a name="246636192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246636192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246636192">(Jul 20 2021 at 19:18)</a>:</h4>
<p>and I tend to agree that the sync one should be favored with the <code>Lazy</code> name, but that leaves the question of what to name the other one, since we have no established pattern of naming something like this</p>



<a name="246636594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246636594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246636594">(Jul 20 2021 at 19:21)</a>:</h4>
<p>from what I can tell the proposed rename is to make the unsync version <code>std::cell::LazyCell</code> and the sync version <code>std::lazy::Lazy</code>. this piggybacks on the idea that <code>std::cell</code> is for "things that aren't Sync"</p>



<a name="246636752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/moving%20once%20cell%20forward/near/246636752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/moving.20once.20cell.20forward.html#246636752">(Jul 20 2021 at 19:23)</a>:</h4>
<p>this seems like a pretty reasonable organization to me</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>